{extend name="admin/public/base"/}
{block name="body"}
<div class="box box-primary">
	<div class="box-header with-border">
		<h3 class="box-title">{$meta_title}</h3>
		<div class="box-tools pull-right">
			<a class="btn btn-sm btn-primary" href="{:url('/admin/menu/add',['pid'=>input('get.pid',0)])}">新 增</a>
			<button class="btn btn-sm btn-danger ajax-post confirm" url="{:url('/admin/menu/del')}" data-form="ids">删 除</button>
			<a class="btn btn-sm btn-success" href="{:url('/admin/menu/import',array('pid'=>input('get.pid',0)))}">导 入</a>
		</div>
	</div>
	<div class="box-body">
		<form class="ids">
			<div class="table-responsive clearfix">
				<table class="table table-hover">
					<thead>
						<tr>
							<th class="row-selected">
								<input class="checkbox check-all" type="checkbox">
							</th>
							<th>ID</th>
							<th>名称</th>
							<th>分组</th>
							<th>URL</th>
							<th>排序</th>
							<th>仅开发者模式显示</th>
							<th>隐藏</th>
							<th>操作</th>
						</tr>
					</thead>

					<tbody>
					{notempty name="list"}
						{volist name="list" id="menu"}
							<tr>
								<td><input class="ids row-selected" type="checkbox" name="id[]" value="{$menu.id}"></td>
								<td>{$menu.id}</td>
								<td>
									{$menu['level_show']|raw}
									<a href="#" class="editable editable-click" data-id="{$menu['id']}" data-name="title" data-type="text" data-pk="{$menu['id']}" data-url="{:url('/admin/menu/editable')}">{$menu['title']}</a>
									<a class="add-sub-cate" title="添加子分类" href="{:url('/admin/menu/add', ['pid' => $menu['id']])}">
										<i class="fa fa-plus-square"></i>
									</a>
								</td>
								<td><a href="#" class="editable editable-click" data-id="{$menu['id']}" data-name="group" data-type="text" data-pk="{$menu['id']}" data-url="{:url('/admin/menu/editable')}">{$menu.group}</a></td>
								<td><a href="#" class="editable editable-click" data-id="{$menu['id']}" data-name="url" data-type="text" data-pk="{$menu['id']}" data-url="{:url('/admin/menu/editable')}">{$menu.url}</a></td>
								<td><a href="#" class="editable editable-click" data-id="{$menu['id']}" data-name="sort" data-type="text" data-pk="{$menu['id']}" data-url="{:url('/admin/menu/editable')}">{$menu['sort']}</a></td>
								<td>
									<a href="{:url('/admin/menu/toogleDev',array('id'=>$menu['id'],'value'=>abs($menu['is_dev']-1)))}"
									   class="ajax-get">
										{$menu['is_dev_text']}
									</a>
								</td>
								<td>
									<a href="{:url('/admin/menu/toogleHide',array('id'=>$menu['id'],'value'=>abs($menu['hide']-1)))}"
									   class="ajax-get">
										{$menu['hide_text']}
									</a>
								</td>
								<td>
									<a title="编辑" href="{:url('/admin/menu/edit', ['id' =>$menu['id']])}">编辑</a>
									<a class="confirm ajax-get" title="删除" href="{:url('/admin/menu/del', ['id' =>$menu['id']])}">删除</a>
								</td>
							</tr>
						{/volist}
					{else/}
						<td colspan="10" class="text-center"> aOh! 暂时还没有内容!</td>
					{/notempty}
					</tbody>
				</table>
			</div>
		</form>
	</div>
</div>
{/block}